package com.gwt.auth.api;

import com.gwt.auth.params.TokenForm;
import com.gwt.auth.vo.AuthTokenVO;
import com.gwt.cloud.result.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Api(tags = "身份认证")
@RequestMapping("/auth/user")
public interface AuthApi {

    @ApiOperation(value = "创建token",notes = "创建token")
    @PostMapping("/token/create")
    ApiResult<AuthTokenVO> tokenCreate(@RequestParam TokenForm form);

    @ApiOperation(value = "token认证",notes = "token认证")
    @PostMapping("/token/validate")
    ApiResult<AuthTokenVO> tokenValidate();

    @ApiOperation(value = "token刷新",notes = "token刷新(一般不主动刷新)")
    @PostMapping("/token/refresh")
    ApiResult<AuthTokenVO> tokenRefresh(@RequestParam TokenForm form);

    @ApiOperation(value = "token清理",notes = "token清理（退出登陆）")
    @PostMapping("/token/clean")
    ApiResult tokenClean();
}
